<!DOCTYPE html>
<html lang="en">
	<head>
		<title>nTube: Browser Check</title>
		<link rel="preload" href="resources/promise-queues.js" as="script" />
		<link rel="preload" href="resources/libWeb.js" as="script" />
		<link rel="preload" href="resources/base.js" as="script" />
		<link rel="preload" href="resources/nplayer_mse/nMuxer.js" as="script" />
		<link rel="preload" href="resources/settings.js" as="script" />
		<link rel="preload" href="resources/search.js" as="script" />
		<link rel="preload" href="resources/ntube_next/nTubeNextAPI.js" as="script" />
		<meta charset="UTF-8" />
		<meta name="application-name" content="nTube" />
		<meta name="theme-color" content="#282828" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta name="iwebkit-use-fruit-styled-layout" value="true;version=1" />
		<meta name="robots" content="noindex, nofollow" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="description" content="nTube: Browser Check." />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<link rel="manifest" href="/manifest.json" />
		<link rel="apple-touch-icon" href="/resources/logos/ntube-logo-192.png" />
		<script src="resources/promise-queues.js"></script>
		<script src="resources/libWeb.js"></script>
		<script src="resources/base.js"></script>
		<script src="resources/nplayer_mse/nMuxer.js"></script>
		<script src="resources/settings.js"></script>
		<script src="resources/search.js"></script>
		<script src="resources/ntube_next/nTubeNextAPI.js"></script>
		<link rel="stylesheet" type="text/css" href="resources/base.css" />
		<link rel="stylesheet" type="text/css" href="resources/search.css" />
		<style id="poly-item-css">
			.poly-item {
				padding-left: 5px;
				box-shadow: 0 14px 28px rgba(255, 255, 255, 0.11), 0 10px 10px rgba(255, 255, 255, 0.08);
				border: 1px solid white;
				margin-bottom: 10px;
			}
		</style>
		<style id="body-css">
			body {
				background-color: black;
				color: white;
			}
		</style>
		<style>
			* {
				-webkit-font-smoothing: antialiased;
				-moz-osx-font-smoothing: grayscale;
			}

			.menu {
				position: fixed;
				top: 0;
				margin: auto;
				left: 0;
				right: 0;
				width: 100%;
				height: 32px;
				border-bottom: 1px solid green;
				margin-right: 0px;
				z-index: 15;
				display: flex;
			}

			.menu-item {
				flex: 1;
				max-width: 50%;
				overflow: hidden;
				white-space: nowrap;
			}

			.poly-item-light {
				padding-left: 5px;
				box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.12);
				border: 1px solid black;
				margin-bottom: 10px;
			}

			.hide_on_overflow {
				text-overflow: ellipsis;
				overflow: hidden;
			}
		</style>
		<style id="_css_fonts">
			html {
				font-family: -apple-system, BlinkMacSystemFont, "Product Sans", "Google Sans", "Segoe UI", "Arial", sans-serif;
			}
		</style>
	</head>

	<body>
		<div class="menu">
			<div class="menu-item">
				<p style="padding-left: 5px; margin-top: 5px; vertical-align: middle; font-weight: bold; display: inline-block; margin-right: 15px; width: auto">
					<span style="color: red">n</span><span id="ntube_main_menu_tube_label" style="color: lightgreen">Tube</span>
					<sub id="ntube_version_main_menu_label" style="font-size: 0.9em; line-height: 25%">1.5.0</sub>
					<img id="ntube-winter-logo" src="resources/events/christmas.png" title="Merry Christmas!" decoding="async" />
				</p>
				<div style="display: inline-block; vertical-align: middle; margin-right: 5px">
					<a href="/" title="Home Page">
						<img src="resources/icons/home.svg" alt="home" style="height: 2em; width: 2em" decoding="async" />
					</a>
				</div>
				<div style="display: inline-block; vertical-align: middle; margin-right: 5px">
					<a href="/trending" title="Trending Videos">
						<img src="resources/icons/trending.svg" alt="trending" style="height: 2em; width: 2em" decoding="async" />
					</a>
				</div>
				<div style="display: inline-block; vertical-align: middle; margin-right: 5px; margin-bottom: 3px">
					<a href="/settings" title="Settings">
						<img src="resources/icons/settings.svg" alt="settings" style="height: 2em; width: 2em" decoding="async" />
					</a>
				</div>
			</div>
			<div class="menu-item">
				<div style="height: 100%; display: flex">
					<style>
						#search_overlay {
							z-index: 8;
							position: fixed;
							background-color: rgba(0, 0, 0, 0.95);
							width: 100%;
							height: 100%;
							top: 0px;
							left: 0px;
						}

						.search_hidden {
							display: none;
							visibility: hidden;
						}

						#search_bar {
							background-color: inherit;
							color: inherit;
							border: none;
							border-left: 1px solid green;
							height: 100%;
							transition: border-bottom 0.5s ease-in-out;
							font-family: monospace;
							font-size: large;
							text-indent: 5px;
							flex-grow: 1;
							min-width: 50%;
						}

						#search_bar:focus {
							border-bottom: 1px solid green;
						}

						#search_button {
							border: none;
							border-left: 1px solid rgba(0, 128, 0, 0.7);
							border-right: none;
							height: 100%;
							background-color: inherit;
							color: inherit;
							margin-right: 0px;
							font-family: inherit;
						}
					</style>
					<input id="search_bar" type="text" name="Search nTube Bar." placeholder="Search nTube." />
					<button id="search_button" onclick="search_start(null);">Search</button>
				</div>
			</div>
			<script>
				run_async(function () {
					SearchBar.init();
					id("_search_results").innerHTML = "";
				});
			</script>
		</div>
		<div id="search_overlay" class="search_hidden">
			<div style="padding-bottom: 30px"></div>
			<!--search_hidden-->
			<div style="width: 100%">
				<div style="float: left; padding-left: 5px">
					<h1 style="margin-top: 5px; margin-bottom: 5px">Search.</h1>
					<h3 style="margin-top: 5px; margin-bottom: 10px">Searching for <span id="search_query_display_string">uhhh...nothing.</span>.</h3>
				</div>
				<div style="float: right; padding-right: 15px; padding-top: 15px">
					<button style="width: 100px; height: 50px; border-radius: 30px; border: 1px solid green; background-color: inherit; color: inherit" onclick="search_close()">Close.</button>
					<script>
						function search_close() {
							id("search_overlay").classList.add("search_hidden");
						}
					</script>
				</div>
				<div style="clear: both"></div>
			</div>
			<div id="_search_results" class="poly-item" style="width: calc(100% - 30px); height: 78%; margin-right: 0px; overflow-y: auto; margin-left: 5px">
				<div class="search-item">
					<a class="search-link" href="#gotoShittyVideo">
						<img src="" alt="TOTALLY NOT CLICKBAIT" style="padding-left: 5px; display: inline; vertical-align: middle; width: 220px; height: 160px; margin-bottom: 5px" />
						<div style="padding-left: 15px; display: inline; vertical-align: middle">
							<p style="position: absolute; display: inline; vertical-align: middle; font-size: large; margin-top: 15px">CLICKBAIT TITLE</p>
							<p style="position: absolute; display: inline; vertical-align: bottom; font-size: small; margin-top: 45px">00:00 | -1 | <a href="#gotoShittyChannel">CHANNEL #2492049</a></p>
						</div>
					</a>
				</div>
			</div>
			<center>
				<button id="_search_load_more">Load more.</button>
			</center>
			<script>
				run_promise(function () {
					id("_search_results").innerHTML = "";
				});
			</script>
		</div>
		<div style="padding-bottom: 30px"></div>
		<h2 style="margin-top: 0px; margin-bottom: 5px">Check my browser.</h2>
		<p style="margin-top: 5px; margin-bottom: 10px">This page can be used to detect the features that your browser can use.</p>
		<div class="poly-item">
			<h2 style="margin-top: 5px; margin-bottom: 5px">Essentials.</h2>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">ECMAScript Support</h3>
				<h3 class="flex_one_compat" id="_js_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">Cookie Support</h3>
				<h3 class="flex_one_compat" id="_ck_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">HTML5 Video Support</h3>
				<h3 class="flex_one_compat" id="_vid_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 10px; margin-top: 5px">LocalStorage Support&nbsp;<span style="color: darkgray">(optional)</span></h3>
				<h3 class="flex_one_compat" id="_ls_supported" style="color: red; margin-bottom: 10px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<script defer="defer">
				run_async(function () {
					id("_js_supported").innerHTML = "SUPPORTED";
					id("_js_supported").style.color = "green";
					if (window && window.navigator && window.navigator.cookieEnabled && window.navigator.cookieEnabled === true) {
						id("_ck_supported").innerHTML = "SUPPORTED";
						id("_ck_supported").style.color = "green";
					}
					if (typeof Storage === "function" || typeof Storage === "object") {
						id("_ls_supported").innerHTML = "SUPPORTED";
						id("_ls_supported").style.color = "green";
					}
					if (typeof document.createElement("video").canPlayType != "undefined") {
						id("_vid_supported").innerHTML = "SUPPORTED";
						id("_vid_supported").style.color = "green";
					}
				});
			</script>
		</div>
		<p id="--browser-info" style="text-align: center">Awaiting script information... (ECMAScript is required)</p>
		<div class="poly-item">
			<h2 style="margin-top: 5px; margin-bottom: 5px">Playback.</h2>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat hide_on_overflow" style="margin-bottom: 5px; margin-top: 5px">MMS Support&nbsp;<span style="color: darkgray">(unimplemented)</span></h3>
				<h3 class="flex_one_compat" id="_wv_mms_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">MSE Support</h3>
				<h3 class="flex_one_compat" id="_wv_mse_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<p style="padding-left: 15px; font-size: medium; margin-bottom: 5px">
				MMS is only supported on recent (June 2023, beta only) Safari-based browsers. <br />
				Only one of these is required for native synchronization support. <br />
				This is required by all playback engines except nPlayer.
			</p>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">Alternative Sync Support</h3>
				<h3 class="flex_one_compat" id="_wv_ms_alt_supported" style="color: orangered; margin-bottom: 5px; text-align: right; margin-top: 5px">No methods found.</h3>
			</div>
			<p style="padding-left: 15px; font-size: medium; margin-top: 5px; margin-bottom: 10px">Applies to nPlayerNX only. (optional)</p>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">nMuxer: Chunk Size</h3>
				<h3 class="flex_one_compat" id="_nmx_csize" style="color: inherit; margin-bottom: 5px; text-align: right; margin-top: 5px">469 KB</h3>
			</div>
			<p style="padding-left: 15px; font-size: medium; margin-top: 5px; margin-bottom: 5px">The amount of data is used per chunk, defaults to 469KB if unsupported.</p>
			<h3 style="padding-left: 15px">Video Codec Support</h3>
			<center>
				<table summary="Supported Codecs on your browser." style="padding-bottom: 15px">
					<tr>
						<th style="border-bottom: 1px solid green; padding-left: 10px; padding-right: 10px">Codec</th>
						<th style="border-bottom: 1px solid green">Is Supported?</th>
					</tr>
					<tr>
						<td>MP4 (H.264)</td>
						<td id="_codec_support_mp4" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>WebM (VP9)</td>
						<td id="_codec_support_webm" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>AV1 (AV01)</td>
						<td id="_codec_support_av1" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>HEVC (H.265)</td>
						<td id="_codec_support_hevc" style="color: red; text-align: center">NO</td>
					</tr>
				</table>
			</center>
			<center>
				<p style="margin-top: 5px; margin-bottom: 5px; font-style: italic">
					Indirect(ly): nTube had to tell the browser what codec variant was being used before getting the OK sign. <br />
					Direct(ly): This browser treats the codec as expected, everything is OK. <br />
					Very old WebKit-based browsers may lie about HEVC and AV1 support. <br />
				</p>
			</center>
			<script defer="defer">
				run_async(function () {
					try {
						id("--browser-info").innerHTML = 'You are using "' + libWeb.BrowserEnvironment.getBrowserVersion() + '", probably.';
					} catch (ex) {}
					if (typeof window.MediaSource === "function") {
						if (window.MediaSource.__NTUBE_EMULATED) {
							id("_wv_mse_supported").innerHTML = "EMULATED";
							id("_wv_mse_supported").style.color = "orangered";
						} else {
							id("_wv_mse_supported").innerHTML = "SUPPORTED";
							id("_wv_mse_supported").style.color = "green";
						}
					}
					if (typeof window.ManagedMediaSource === "function") {
						id("_wv_mms_supported").innerHTML = "SUPPORTED";
						id("_wv_mms_supported").style.color = "green";
					}
					if (typeof MediaController !== "undefined") {
						id("_wv_ms_alt_supported").innerHTML = "MediaController API";
						id("_wv_ms_alt_supported").style.color = "green";
					}
					try {
						const throughputValue = nTubeNext.NetworkThroughput.get();
						if (typeof throughputValue === "number" && throughputValue != -1) {
							id("_nmx_csize").innerHTML = nMuxerUtils.formatBytes(throughputValue);
						} else {
							id("_nmx_csize").innerHTML = "Testing...";
							try {
								throughputValue
									.then(function (value) {
										id("_nmx_csize").innerHTML = nMuxerUtils.formatBytes(value);
									})
									.catch(function (error) {
										console.error(error);
										id("_nmx_csize").innerHTML = "ERROR";
									});
							} catch (_ex) {
								// ???????????????
								console.error(_ex);
								id("_nmx_csize").innerHTML = "ERROR";
							}
						}
					} catch (e) {
						try {
							id("_nmx_csize").innerHTML = nMuxerUtils.formatBytes(nMuxerUtils.getSegmentSizeForNetworkSpeed());
						} catch (ex) {
							console.error(ex);
						}
					}
					if ((window.MediaSource && "isTypeSupported" in window.MediaSource) || (window.ManagedMediaSource && "isTypeSupported" in window.ManagedMediaSource) || window.HTMLMediaElement) {
						if (canPlayCodec("video/mp4")) {
							id("_codec_support_mp4").innerHTML = "YES";
							id("_codec_support_mp4").style.color = "green";
						} else if (canPlayCodec('video/mp4; codecs="avc1.42001E, mp4a.40.2"')) {
							id("_codec_support_mp4").innerHTML = "YES (Indirect)";
							id("_codec_support_mp4").style.color = "green";
						}
						if (canPlayCodec("video/webm")) {
							id("_codec_support_webm").innerHTML = "YES";
							id("_codec_support_webm").style.color = "green";
						} else if (canPlayCodec('video/webm; codecs="vp9"')) {
							id("_codec_support_webm").innerHTML = "YES (Indirect)";
							id("_codec_support_webm").style.color = "green";
						}
						if (canPlayCodec('video/webm; codecs="av1"')) {
							id("_codec_support_av1").innerHTML = "YES (Direct)";
							id("_codec_support_av1").style.color = "green";
						} else if (canPlayCodec('video/mp4; codecs="av1"') || canPlayCodec('video/webm; codecs="av1"') || canPlayCodec('video/mp4; codecs="av01.0.04M.08"')) {
							id("_codec_support_av1").innerHTML = "YES (Indirect)";
							id("_codec_support_av1").style.color = "green";
						}
						if (canPlayCodec('video/mp4; codecs="hevc"')) {
							id("_codec_support_hevc").innerHTML = "YES (Direct)";
							id("_codec_support_hevc").style.color = "green";
						} else if (canPlayCodec('video/mp4; codecs="hev1.1.6.L93.90"') || canPlayCodec('video/mp4; codecs="hvc1.1.6.L93.90"')) {
							id("_codec_support_hevc").innerHTML = "YES (Indirect)";
							id("_codec_support_hevc").style.color = "green";
						}
					} else {
						id("_codec_support_mp4").innerHTML = "NO [MSE MISSING]";
						id("_codec_support_webm").innerHTML = "NO [MSE MISSING]";
						id("_codec_support_av1").innerHTML = "NO [MSE MISSING]";
						id("_codec_support_hevc").innerHTML = "NO [MSE MISSING]";
					}
				});
			</script>
			<h3 style="padding-left: 15px">Audio Codec Support</h3>
			<center>
				<table summary="Supported Codecs on your browser." style="padding-bottom: 15px">
					<tr>
						<th style="border-bottom: 1px solid green; padding-left: 10px; padding-right: 10px">Codec</th>
						<th style="border-bottom: 1px solid green">Is Supported?</th>
					</tr>
					<tr>
						<td>AAC</td>
						<td id="_codec_support_aac" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>Opus</td>
						<td id="_codec_support_opus" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>AC3 (DD)</td>
						<td id="_codec_support_ac3" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>EAC3 (DD+)</td>
						<td id="_codec_support_eac3" style="color: red; text-align: center">NO</td>
					</tr>
					<tr>
						<td>DTS</td>
						<td id="_codec_support_dts" style="color: red; text-align: center">NO</td>
					</tr>
				</table>
			</center>
			<script defer="defer">
				run_async(function () {
					if ((window.MediaSource && "isTypeSupported" in window.MediaSource) || (window.ManagedMediaSource && "isTypeSupported" in window.ManagedMediaSource) || window.HTMLMediaElement) {
						if (canPlayCodec('video/mp4; codecs="mp4a.40.2"')) {
							id("_codec_support_aac").innerHTML = "YES";
							id("_codec_support_aac").style.color = "green";
						}
						if (canPlayCodec('audio/webm; codecs="opus"')) {
							id("_codec_support_opus").innerHTML = "YES";
							id("_codec_support_opus").style.color = "green";
						}
						if (canPlayCodec('video/mp4; codecs="ac-3"')) {
							id("_codec_support_ac3").innerHTML = "YES";
							id("_codec_support_ac3").style.color = "green";
						}
						if (canPlayCodec('video/mp4; codecs="ec-3"')) {
							id("_codec_support_eac3").innerHTML = "YES";
							id("_codec_support_eac3").style.color = "green";
						}
						if (canPlayCodec('video/mp4; codecs="dts+"') || canPlayCodec('video/mp4; codecs="dts-"') || canPlayCodec('video/mp4; codecs="dtsc"')) {
							id("_codec_support_dts").innerHTML = "YES";
							id("_codec_support_dts").style.color = "green";
						}
					}
				});
			</script>
			<div style="margin-left: 15px">
				<h3>Video Acceleration</h3>
				<center style="overflow-y: scroll">
					<table summary="Video Acceleration on your browser." style="padding-bottom: 15px">
						<tr>
							<th style="border-bottom: 1px solid green; padding-left: 10px; padding-right: 10px">Codec</th>
							<th style="border-bottom: 1px solid green">8K</th>
							<th style="border-bottom: 1px solid green">4K</th>
							<th style="border-bottom: 1px solid green">1440p</th>
							<th style="border-bottom: 1px solid green">1080p (v2)</th>
							<th style="border-bottom: 1px solid green">1080p</th>
							<th style="border-bottom: 1px solid green">720p</th>
							<th style="border-bottom: 1px solid green">480p</th>
						</tr>
						<tr>
							<td>H.264</td>
							<td id="_va_h264_8k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h264_4k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h264_1440" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h264_1080_v2" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h264_1080" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h264_720" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h264_480" style="color: red; text-align: center">UNKNOWN</td>
						</tr>
						<tr>
							<td>H.265<br /><i>(optional)</i></td>
							<td id="_va_h265_8k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h265_4k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h265_1440" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h265_1080_v2" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h265_1080" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h265_720" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_h265_480" style="color: red; text-align: center">UNKNOWN</td>
						</tr>
						<tr>
							<td>VP9</td>
							<td id="_va_vp9_8k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_vp9_4k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_vp9_1440" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_vp9_1080_v2" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_vp9_1080" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_vp9_720" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_vp9_480" style="color: red; text-align: center">UNKNOWN</td>
						</tr>
						<tr>
							<td>AV01</td>
							<td id="_va_av1_8k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_av1_4k" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_av1_1440" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_av1_1080_v2" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_av1_1080" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_av1_720" style="color: red; text-align: center">UNKNOWN</td>
							<td id="_va_av1_480" style="color: red; text-align: center">UNKNOWN</td>
						</tr>
					</table>
				</center>
				<script defer="defer">
					run_async(function () {
						const QS = [
							["8k", 7680, 4320],
							["4k", 3840, 2160],
							["1440", 2560, 1440],
							["1080_v2", 2048, 1152],
							["1080", 1920, 1080],
							["720", 1280, 720],
							["480", 640, 480],
						];
						const QC = ["h264", "h265", "vp9", "av1"];
						try {
							if (nTubeNext.VideoAcceleration.isSupported()) {
								for (var _codec of QC) {
									const codec = _codec;
									var _videoCodec = null;
									if (codec === "h264") {
										_videoCodec = 'video/mp4; codecs="avc1.640028"';
									} else if (codec === "h265") {
										_videoCodec = 'video/mp4; codecs="hev1.1.6.L93.90"';
									} else if (codec === "vp9") {
										_videoCodec = 'video/webm; codecs="vp09.00.10.08"';
									} else {
										_videoCodec = 'video/mp4; codecs="av01.0.01M.08"';
									}
									const videoCodec = _videoCodec;
									run_async(function () {
										for (var nn of QS) {
											const n = nn;
											const op = {
												audioCodec: 'audio/webm; codecs="opus"',
												videoCodec: videoCodec,
												width: n[1],
												height: n[2],
												fps: "30",
											};
											nTubeNext.VideoAcceleration.getAccelerationFor(op, function (r) {
												if (r === undefined) {
													id("_va_" + codec + "_" + n[0]).innerHTML = "QUERY_FAILED";
												} else {
													if (r.result === "SOFTWARE_ACCELERATED") {
														id("_va_" + codec + "_" + n[0]).innerHTML = "PARTIAL";
														id("_va_" + codec + "_" + n[0]).style.color = "orange";
													} else if (r.result === "HARDWARE_ACCELERATED") {
														id("_va_" + codec + "_" + n[0]).innerHTML = "FULL";
														id("_va_" + codec + "_" + n[0]).style.color = "green";
													} else if (r.result === "SOFTWARE") {
														id("_va_" + codec + "_" + n[0]).innerHTML = "NONE";
														id("_va_" + codec + "_" + n[0]).style.color = "orangered";
													} else if (r.result === "UNDECODABLE") {
														id("_va_" + codec + "_" + n[0]).innerHTML = "UNDECODABLE";
													}
												}
											});
										}
									});
								}
							}
						} catch (e) {
							console.error(e);
						}
					});
				</script>
				<center>
					<table style="margin-bottom: 10px; padding: 5px; overflow-y: scroll">
						<tr>
							<th style="border-bottom: 1px solid darkgreen">Result</th>
							<th style="border-bottom: 1px solid darkgreen">Meaning</th>
						</tr>
						<tr>
							<td>FULL</td>
							<td>The codec is hardware accelerated and does not drop frames.</td>
						</tr>
						<tr>
							<td>PARTIAL</td>
							<td>
								The codec is probably hardware accelerated but some frames may be dropped. <br />
								Expect potentially higher CPU usage and lower battery life.
							</td>
						</tr>
						<tr>
							<td>NONE</td>
							<td>This codec has no acceleration and will degrade performance and battery life.</td>
						</tr>
						<tr>
							<td>UNDECODABLE</td>
							<td>This browser or device does not support this codec or resolution.</td>
						</tr>
						<tr>
							<td>UNKNOWN</td>
							<td>The API for querying browser capabilities is unavailable.</td>
						</tr>
					</table>
					<p>1080p (version 2) tests your hardware decoder if it is capable of doing 2048x1152 decoding.</p>
				</center>
			</div>
		</div>
		<div class="poly-item" style="padding-left: 15px">
			<h2 style="margin-left: -10px; margin-top: 5px; margin-bottom: 5px">360&deg; support.</h2>
			<div class="flex_display" style="padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">WebGL 1.0 Support</h3>
				<h3 class="flex_one_compat" id="_wgl1_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<div class="flex_display" style="padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">WebGL 2.0 Support</h3>
				<h3 class="flex_one_compat" id="_wgl2_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<div class="flex_display" style="padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">WebGPU Support</h3>
				<h3 class="flex_one_compat" id="_wgpu_supported" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">UNSUPPORTED</h3>
			</div>
			<script defer="defer">
				function supportsWebGL2() {
					try {
						var canvas = document.createElement("canvas");
						var gl = canvas.getContext("webgl2");
						return gl && gl instanceof WebGL2RenderingContext;
					} catch (e) {
						console.error("supportsWebGL2() -> \n" + e);
						return false;
					}
				}
				function supportsWebGL() {
					try {
						var canvas = document.createElement("canvas");
						var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl") || canvas.getContext("moz-webgl") || canvas.getContext("webkit-3d") || canvas.getContext("3d");
						return gl && gl instanceof WebGLRenderingContext;
					} catch (e) {
						console.error("supportsWebGL() -> \n" + e);
						return false;
					}
				}
				function supportsWebGPU() {
					try {
						return "gpu" in navigator;
					} catch (e) {
						console.error("supportsWebGPU() -> \n" + e);
						return false;
					}
				}
				run_async(function () {
					if (supportsWebGL()) {
						id("_wgl1_supported").innerHTML = "SUPPORTED";
						id("_wgl1_supported").style.color = "green";
					}
					if (supportsWebGL2()) {
						id("_wgl2_supported").innerHTML = "SUPPORTED";
						id("_wgl2_supported").style.color = "green";
					}
				});
			</script>
			<p style="text-align: center; margin-top: 5px; margin-bottom: 5px"><i>Only one of these is required for 360-degree content support.</i></p>
		</div>
		<!--<div class="poly-item">
			<h2 style="margin-top: 5px; margin-bottom: 5px">nMusic/nTV specific stuff.</h2>
			<div>
				<h3 style="float: left; padding-left: 15px; line-height: 0%">Widevine DRM support</h3>
				<h3 id="_wv_cdn_supported" style="float: right; padding-right: 15px; color: red; line-height: 0%">UNSUPPORTED</h3>
				<div style="clear: both"></div>
				<p style="padding-left: 15px; font-size: medium; float: left; line-height: 0%">This is required for [redacted] playback.</p>
				<p id="_wv_cdn_supported_message" style="padding-right: 15px; font-size: small; float: right; line-height: 0%"></p>
				<div style="clear: both; margin-bottom: 10px"></div>
				<script>
					run_async(function () {
						try {
							var config = [
								// What living fuck chose this config. Also >Not using hardware decoding.
								{
									label: "video-sw-decode",
									initDataTypes: ["cenc"],
									audioCapabilities: [
										{
											contentType: 'audio/mp4; codecs="mp4a.40.2"',
											robustness: "SW_SECURE_CRYPTO",
										},
									],
									videoCapabilities: [
										{
											contentType: 'video/webm; codecs="vp8"',
											robustness: "SW_SECURE_DECODE",
										},
										{
											contentType: 'video/mp4; codecs="avc1.4d401f"',
											robustness: "SW_SECURE_DECODE",
										},
										{
											contentType: 'video/mp2t; codecs="avc1.4d401f"',
											robustness: "SW_SECURE_DECODE",
										},
									],
									distinctiveIdentifier: "optional",
									persistenceState: "optional",
									sessionTypes: ["temporary"],
								},
								{
									label: "video-sw-crypto",
									initDataTypes: ["cenc"],
									audioCapabilities: [
										{
											contentType: 'audio/mp4; codecs="mp4a.40.2"',
											robustness: "SW_SECURE_CRYPTO",
										},
									],
									videoCapabilities: [
										{
											contentType: 'video/webm; codecs="vp8"',
											robustness: "SW_SECURE_CRYPTO",
										},
										{
											contentType: 'video/mp4; codecs="avc1.4d401f"',
											robustness: "SW_SECURE_CRYPTO",
										},
										{
											contentType: 'video/mp2t; codecs="avc1.4d401f"',
											robustness: "SW_SECURE_CRYPTO",
										},
									],
									distinctiveIdentifier: "optional",
									persistenceState: "optional",
									sessionTypes: ["temporary"],
								},
								{
									label: "audio-sw-crypto",
									initDataTypes: ["cenc"],
									audioCapabilities: [
										{
											contentType: 'audio/mp4; codecs="mp4a.40.2"',
											robustness: "SW_SECURE_CRYPTO",
										},
									],
									videoCapabilities: [],
									distinctiveIdentifier: "optional",
									persistenceState: "optional",
									sessionTypes: ["temporary"],
								},
							];
							var _wv_cdn_supported = id("_wv_cdn_supported");
							var _wv_cdn_supported_msg = id("_wv_cdn_supported_message");
							navigator.requestMediaKeySystemAccess("com.widevine.alpha", config).then(function (mediaKeySystemAccess) {
								console.log("Widevine seems to be supported.");
								if (typeof mediaKeySystemAccess.createMediaKeys === "function") {
									console.log("Testing full support.");
									mediaKeySystemAccess
										.createMediaKeys()
										.then(function (mk) {
											console.log(mk);
											_wv_cdn_supported.innerHTML = "SUPPORTED";
											_wv_cdn_supported.style.color = "green";
										})
										.catch(function (e) {
											console.error(e);
											console.error(e.message);
											if (e.message === "Failed to execute 'createMediaKeys' on 'MediaKeySystemAccess': EME use is not allowed on unique origins.") {
												_wv_cdn_supported.innerHTML = "SUPPORTED";
												_wv_cdn_supported.style.color = "green";
												_wv_cdn_supported_msg.innerHTML = "Hit an unique origin error, assuming supported.";
												_wv_cdn_supported_msg.style.color = "orange";
											} else {
												_wv_cdn_supported.innerHTML = "SUPPORTED?";
												_wv_cdn_supported.style.color = "orange";
												_wv_cdn_supported_msg.innerHTML = "GetCDM failure? Is your browser setup incorrectly?";
												_wv_cdn_supported_msg.style.color = "orange";
											}
										});
								} else {
									_wv_cdn_supported.innerHTML = "UNSUPPORTED?";
									_wv_cdn_supported.style.color = "orange";
									_wv_cdn_supported_msg.innerHTML = "createMediaKeys is missing, is your browser setup incorrectly?";
									_wv_cdn_supported_msg.style.color = "orange";
								}
							});
						} catch (e) {
							console.error(e);
							_wv_cdn_supported.innerHTML = "UNSUPPORTED";
							_wv_cdn_supported.style.color = "red";
						}
					});
				</script>
			</div>
		</div>-->
		<div class="poly-item">
			<h2 style="margin-top: 5px; margin-bottom: 10px">Browser Specific Stuff.</h2>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">UI Acceleration Method</h3>
				<h3 class="flex_one_compat" id="_nui_acceleration_method" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">Fallback</h3>
			</div>
			<script defer="defer">
				run_async(function () {
					try {
						const _nui_acceleration_method = id("_nui_acceleration_method");
						if (typeof window.queueMicrotask === "function" && !(window.scheduler && window.scheduler.postTask) && !window.LIBWEB_HAS_MICROTASK_POLYFILL) {
							_nui_acceleration_method.innerHTML = "Asynchronous Microtasks";
							_nui_acceleration_method.style.color = "green";
						} else if (window.scheduler && window.scheduler.postTask) {
							_nui_acceleration_method.innerHTML = "SchedulerAPI";
							_nui_acceleration_method.style.color = "green";
						} else if (window.Promise && typeof PromiseQueuePlus !== "undefined") {
							_nui_acceleration_method.innerHTML = "Queued Promises";
							_nui_acceleration_method.style.color = "green";
						} else if (window.Promise) {
							_nui_acceleration_method.innerHTML = "PromiseAPI";
							_nui_acceleration_method.style.color = "orange";
						} else {
							_nui_acceleration_method.innerHTML = "Fallback";
							_nui_acceleration_method.style.color = "orangered";
						}
					} catch (e) {
						console.error(e);
					}
				});
			</script>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">Image Acceleration Method</h3>
				<h3 class="flex_one_compat" id="_nui_image_acceleration_method" style="color: red; margin-bottom: 5px; text-align: right; margin-top: 5px">Fallback</h3>
			</div>
			<script defer="defer">
				run_async(function () {
					try {
						const _nui_image_acceleration_method = id("_nui_image_acceleration_method");
						const _nui_image_accel_result = nTubeNext.AcceleratedImage.getAccelerationMethod();
						_nui_image_acceleration_method.innerHTML = _nui_image_accel_result;
						if (_nui_image_accel_result !== "UNSUPPORTED") {
							_nui_image_acceleration_method.style.color = "green";
						}
					} catch (e) {
						console.error(e);
					}
				});
			</script>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">Video Cache Size (seconds)</h3>
				<h3 class="flex_one_compat" id="_brspf_cache_size" style="margin-bottom: 5px; text-align: right; margin-top: 5px">0</h3>
			</div>
			<script defer="defer">
				run_async(function () {
					try {
						id("_brspf_cache_size").innerHTML = getBufferSize().toString();
					} catch (e) {
						console.error(e);
					}
				});
			</script>
			<div class="flex_display" style="padding-left: 15px; padding-right: 15px">
				<h3 class="flex_one_compat" style="margin-bottom: 5px; margin-top: 5px">Video HQ Cache Size (seconds)</h3>
				<h3 class="flex_one_compat" id="_brspf_max_cache_size" style="margin-bottom: 5px; text-align: right; margin-top: 5px">0</h3>
			</div>
			<script defer="defer">
				run_async(function () {
					try {
						id("_brspf_max_cache_size").innerHTML = getHQBufferSize().toString();
					} catch (e) {
						console.error(e);
					}
				});
			</script>
			<h3 style="padding-left: 15px; margin-top: 5px; margin-bottom: 5px">Video Cache Reduction</h3>
			<p id="_brspf_cache_reduction" style="padding-left: 15px; margin-top: 10px; margin-bottom: 10px">No cache reduction flags present.</p>
			<script defer="defer">
				run_async(function () {
					try {
						if (isLowMemoryDevice) {
							id("_brspf_cache_reduction").innerHTML = "Device claims to have below 2048 MB of RAM.";
						} else if (isMobile || is_iPhoneOS()) {
							id("_brspf_cache_reduction").innerHTML = "Device is a phone.";
						} else if (navigator.userAgent.contains("CrKey")) {
							id("_brspf_cache_reduction").innerHTML = "Device is a Chromecast.";
						} else if (typeof InstallTrigger !== "undefined" && ENABLE_DASH_QUIRKS) {
							id("_brspf_cache_reduction").innerHTML = "ENABLE_DASH_QUIRKS is enabled.";
						}
					} catch (e) {
						console.error(e);
					}
				});
			</script>
		</div>
		<style id="ntube-custom-css"></style>
		<script>
			function hasSettings() {
				try {
					const y = Settings.load("ntube_settings");
					return y !== null && isJson(y);
				} catch (e) {
					console.error(e);
					return false;
				}
			}
			run_async(function () {
				try {
					nTube.init();
					nTube.initTheming();
				} catch (e) {}
			});
			run_async(function () {
				if (hasSettings()) {
					console.debug("Loading settings...");
					window.__SETTINGS_OBJECT = Settings.load("ntube_settings");
					if (window.__SETTINGS_OBJECT.appearance.enable_new_look) {
						id("poly-item-css").innerHTML =
							".poly-item {padding-left: 5px; box-shadow: 0 14px 28px rgba(255, 255, 255, 0.08), 0 10px 10px rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); margin-bottom: 10px;}";
					}
					if (window.__SETTINGS_OBJECT.appearance.custom_css) {
						try {
							id("ntube-custom-css").innerHTML = base64Decode(window.__SETTINGS_OBJECT.appearance.custom_css);
						} catch (e) {
							console.error(e);
						}
					}
					if (window.__SETTINGS_OBJECT.appearance.use_newer_ui_preset) {
						try {
							id("body-css").innerHTML = "body {background-color: #111111; color: white;}";
						} catch (e) {
							console.error(e);
						}
					}
				}
			});
		</script>
	</body>
</html>
